
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>



<script>
    function deleteUser(uid) {
        //用户安全提示
        if (confirm("您确定要删除吗？")) {
            //访问路径
            location.href = "${pageContext.request.contextPath}/delServlet?uid=" + uid;
        }
    }
</script>

<%--<!DOCTYPE html>--%>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="x-ua-compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width,initial-scale=1">

        <title>管理员操作</title>

        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="css/common.css">

        <script src="js/jquery-3.2.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>

        <!--导入布局js，共享header和footer-->
        <script type="text/javascript" src="js/include.js"></script>
    </head>
    <body>
        <!--        1.页眉-->
        <!--引入头部-->
        <div id="header"></div>

        <!--        2.主体-->
        <div class="container">
            <h3 style="text-align: center">用户信息</h3>

            <div style="float: left; margin: 10px;">
                <form class="form-inline"
                      action="${pageContext.request.contextPath}/findAllServlet"
                      method="post">
                    <div class="form-group">
                        <label for="exampleInputName2">用户名</label> <input type="text"
                                                                         name="username"  class="form-control"
                                                                         id="exampleInputName2" placeholder="该功能尚未完成">
                    </div>

                    <button type="button" class="btn btn-default" >查询</button>
                </form>
            </div>

            <table border="1" class="table table-bordered table-hover">
                <tr class="success">

                    <th>编号</th>
                    <th>用户ID</th>
                    <th>用户名</th>
                    <th>真实姓名</th>
                    <th>生日</th>
                    <th>性别</th>
                    <th>手机号码</th>
                    <th>邮箱</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${users}" var="user" varStatus="s">
                    <tr>

                        <td>${s.count}</td>
                        <td>${user.uid}</td>
                        <td>${user.username}</td>
                        <td>${user.realname}</td>
                        <td>${user.birthday}</td>
                        <td>${user.sex}</td>
                        <td>${user.telephone}</td>
                        <td>${user.email}</td>

                        <td><a class="btn btn-default btn-sm"
                               href="#">修改</a>&nbsp;
                            <a class="btn btn-default btn-sm" href="javascript:deleteUser(${user.uid});">删除</a></td>
                    </tr>

                </c:forEach>





            </table>


        <!--        3.页脚-->

<%--        <script src="js/buttonclass.js"></script>--%>
        <!--导入底部-->
        <div id="footer"></div>

    </body>
</html>